/**
 * plugins/index.js
 *
 * Automatically included in `./src/main.js`
 */

// Plugins
import vuetify from "./vuetify";
import router from "@/router";
import store from "@/store";
import "@/plugins/permission";
import "@/style/common.css";
import JIcon from "@/icon/VIcon.vue";
import "@/css/main.css";
import "@/styles/transition.scss";
import jcUi from "@/jcui/index";
import { $toast } from "@/utils/utils";
import { shallowRef } from "vue";
export function registerPlugins(app) {
  app.use(vuetify).use(jcUi).use(router).use(store);
  app.config.globalProperties.$toast = window.Qmsg;
  app.config.globalProperties.mqtt = $toast;
  app.component("j-icon", JIcon);
  const sgbList = shallowRef([]);
  app.provide("sgbList", sgbList);
  // 初始化列表
  store.dispatch("sgb/setList").then((res) => {
    sgbList.value = res;
  });
  // 初始化音频播放器实例
  store.dispatch("audio/init");
  // 获取浏览器指纹
  store.dispatch("login/getFingerprint");
  // 获取用户信息
  store.dispatch("login/getUserInfo");
}
